"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.LogClearManager = void 0;
const ChargeDao_1 = require("../pay_server/dao/ChargeDao");
const Config_1 = require("../src/config/Config");
const DateUtil_1 = require("../src/engine/utils/DateUtil");
const Logger_1 = require("../src/engine/utils/Logger");
const checkClearClubHistory_Inteval = 1000 * 60 * 60 * 24; //1天检查一次
class LogClearManager {
    constructor() {
        this.last_check_club_time = 0;
    }
    checkClear(now) {
        this.checkClearClubHistory(now);
    }
    checkClearClubHistory(now) {
        if (now - this.last_check_club_time >= checkClearClubHistory_Inteval) {
            let date = new Date();
            if (date.getHours() == 5) { //你见过半夜5点的篮球吗？
                this.last_check_club_time = now;
                // let delete_time: number = now - Config.OneDay * 3; //保留3天记录
                let delete_time = now - Config_1.Config.OneDay * 7; //保留7天记录
                Logger_1.Logger.log("LogClearManager===", delete_time, DateUtil_1.default.formatDateStr(delete_time));
                //定时清理充值垃圾订单
                ChargeDao_1.ChargeDao.clear(delete_time);
            }
        }
    }
}
exports.LogClearManager = LogClearManager;
LogClearManager.instance = new LogClearManager();
